﻿@model IList<HZU.ZP.Domain.Model.Position>
@{
    Layout = "_ApplicatLayout";
}
<link rel="stylesheet" href="~/css/reset.css">
<link rel="stylesheet" href="~/css/citySelect1.css">
<script type="text/javascript">
    $(document).ready(function () {
        $(".eee").mouseover(function () {
            $(this).css({ "background-color": "gainsboro" });
        }).mouseout(function () {
            $(this).css({ "background-color": "" });
        });
        $(".ss").click(function () {
            var selectValue = $(this).text();
            $("#zgSelect").html(selectValue);
        });
        $("#lookUp").click(function () {
            var status, name, provincial, municipal, salary, companySize, companyType;
            if ($("#zgSelect").text() == "职位")
                status = 1;
            else
                status = 2;
            name = $('#name').val();
            provincial = $('#provincial').text();
            municipal = $('#municipal').text();
            salary = $('#salary').text();
            companySize = $('#companySize').text();
            companyType = $('#companyType').text();
            location.href = "/Position/GetPositionList?status=" + status + "&name=" + name + "&provincial=" + provincial +"&municipal=" + municipal + "&salary=" + salary + "&companySize=" + companySize + "&companyType=" + companyType;
        });
    });
</script>

<script type="text/javascript">
    function salary(obj) {
        $('#salary').text($(obj).text());
    }
    function companySize(obj) {
        $('#companySize').text($(obj).text());
    }
    function companyType(obj) {
        $('#companyType').text($(obj).text());
    }
    function reset() {
        $('#provincial').text("工作地点");
        $("#municipal").text("");
        $('#salary').text("薪资要求");
        $('#companySize').text("公司规模");
        $('#companyType').text("公司类型");
        $('#lookUp').click();
    }
    function pageLockUp(i) {
        var status, name, provincial, municipal, salary, companySize, companyType, pageIndex;
        if ($("#zgSelect").text() == "职位")
            status = 1;
        else
            status = 2;
        name = $('#name').val();
        provincial = $('#provincial').text();
        municipal = $('#municipal').text();
        salary = $('#salary').text();
        companySize = $('#companySize').text();
        companyType = $('#companyType').text();
        pageIndex = i;
        location.href = "/Position/GetPositionList?status=" + status + "&name=" + name + "&provincial=" + provincial + "&municipal=" + municipal + "&salary=" + salary + "&companySize=" + companySize + "&companyType=" + companyType + "&pageIndex=" + pageIndex;
    }
</script>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-2 column">
        </div>
        <div class="col-md-8 column">
            <div class="input-group col-md-12">
                <div class="input-group-btn">
                    <div class="btn-group">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <span id="zgSelect">@((int)ViewData["Status"] == 1 ? "职位" : "公司")</span>
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu">
                            <li><a href="javascript:;" class="ss">职位</a></li>
                            <li><a href="javascript:;" class="ss">公司</a></li>
                        </ul>
                    </div>

                </div>
                <input type="text" class="form-control" placeholder="请输入职位名称" id="name" value="@(ViewData["Name"]?.ToString())" />
                <span class="input-group-btn">
                    <button class="btn btn-info btn-search" id="lookUp">查找</button>
                </span>
            </div>
        </div>
        <div class="col-md-2 column">
        </div>
    </div>
    <div style="line-height: 36px;">
        <div class="row clearfix">
            <div class="col-md-3 column">
                <div class="" id="citySelect">
                    <span data-toggle="dropdown" class="dropdown-toggle" id="provincial">@(ViewData["Provincial"]?.ToString() == null ? "工作地点" :ViewData["Provincial"].ToString())</span>
                    <span data-toggle="dropdown" class="dropdown-toggle" id="municipal">@(ViewData["Municipal"]?.ToString() == null ? "" : ViewData["Municipal"].ToString())</span>
                    <strong class="caret"></strong>

                    <div class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1" style="width: 100%">
                        <div class="row clearfix">
                            <div class="col-md-6 column">
                                <ul class="dropProvUl dropUl">
                                </ul>
                            </div>
                            <div class="col-md-6 column">
                                <ul class="dropCityUl dropUl">
                                </ul>
                            </div>
                        </div>
                    </div>

                </div>
                <!--<div class="dropDown">
                    <div class="dropProv">
                        <ul class="dropProvUl dropUl"></ul>
                    </div>
                    <div class="dropCity">
                        <ul class="dropCityUl dropUl"></ul>
                    </div>
                </div>-->
            </div>
            <div class="col-md-3 column">
                <div class="">
                    <span data-toggle="dropdown" class="dropdown-toggle" id="salary">@( ViewData["Salary"]?.ToString() == null ? "薪资要求" :  ViewData["Salary"].ToString())</span>
                    <strong class="caret"></strong>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="salary(this)">0-2K</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="salary(this)">2-4K</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="salary(this)">4-6K</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="salary(this)">6-8K</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="salary(this)">8-10K</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-md-2 column">
                <div class="">
                    <span data-toggle="dropdown" class="dropdown-toggle" id="companySize">@(ViewData["CompanySize"]?.ToString() == null ? "公司规模" : ViewData["CompanySize"].ToString())</span>
                    <strong class="caret"></strong>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companySize(this)">0-20人</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companySize(this)">20-99人</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companySize(this)">100-499人</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companySize(this)">500-999人</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companySize(this)">1000-9999人</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companySize(this)">10000人以上</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-md-2 column">
                <div class="">
                    <span data-toggle="dropdown" class="dropdown-toggle" id="companyType">@(ViewData["CompanyType"]?.ToString() == null ? "公司类型" : ViewData["CompanyType"].ToString())</span>
                    <strong class="caret"></strong>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">国企</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">外资(欧美)</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">外资(非欧美)</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">上市公司</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">合资</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="1" href="javascript:;" onclick="companyType(this)">民营公司</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">政府机关</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">事业单位</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">非营利组织</a>
                        </li>
                        <li role="presentation">
                            <a role="menuitem" tabindex="-1" href="javascript:;" onclick="companyType(this)">创业公司</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-md-2 column">
                <a href="javascript:;" class="btn btn-default btn-link" onclick="reset()">清空筛选条件</a>
            </div>
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-2 column">
            <span>职位名</span>
        </div>
        <div class="col-md-4 column">
            <span>公司名称</span>
        </div>
        <div class="col-md-2 column">
            <span>工作地点</span>
        </div>
        <div class="col-md-2 column">
            <span>资薪</span>
        </div>
        <div class="col-md-2 column">
            <span>发布时间</span>
        </div>

    </div>
    <hr />
    @if (Model.Count() > 0)
    {
        foreach (var pos in Model)
        {
            <div class="eee">
                <div class="row clearfix">
                    <div class="col-md-2 column">
                        <a href="/Position/GetPositionAndCompanyInfo?id=@pos.Id" style="font-size:large;color:red">@pos.Name</a>
                    </div>
                    <div class="col-md-4 column">
                        <a href="/CompanyInformation/GetCompanyInformationA?companyId=@pos.CompanyId">@pos.CompanyName</a>
                    </div>
                    <div class="col-md-2 column">
                        @pos.Provincial&nbsp;@pos.Municipal
                    </div>
                    <div class="col-md-2 column">
                        @pos.Salary
                    </div>
                    <div class="col-md-2 column">
                        @pos.CreateTime.ToString("yyyy-MM-dd")
                    </div>
                </div>
            </div>
        }
    }
    else
    {
        <br />
        <h4 style="height:300px;text-align:center">无数据。。。</h4>
    }
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div style="text-align: center;">
                <ul class="pagination">
                    @for (int i =(int)ViewData["PageIndex"] - 5 <= 0 ? 1 : (int)ViewData["PageIndex"] - 5; i < (int)ViewData["PageIndex"]; i++)
                    {
                        <li><a href="javascript:pageLockUp(@i);">@i</a></li>
                    }
                    @if ((int)ViewData["PageIndex"] > 0)
                    {
                        <li><a href="javascript:;" style="background-color:LightGrey">@((int)ViewData["PageIndex"])</a></li>
                    }
                    @for (int i = (int)ViewData["PageIndex"] + 1; i <= (int)ViewData["Total"] && i < (int)ViewData["PageIndex"] + 5; i++)
                    {
                        <li><a href="javascript:pageLockUp(@i);">@i</a></li>
                    }
                    <li><a style="border :none;background-color:white">&nbsp;&nbsp;&nbsp;&nbsp;共@((int)ViewData["Total"])页</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="~/js/area.js"></script>
<script type="text/javascript" src="~/js/citySelect.js"></script>